

interface A {
	public void printInfo();
}


class B implements A {
	public void printInfo() {
		System.out.println("Hello,world!");
	}

}


public class Anony {
	public static  void main(String args[]) {
		//testFunc(new B()); //OK
		testFunc(new A(){
			public void printInfo() {
				System.out.println("Hello,world!");
			}
		});
	}
	
	public static void testFunc(A a) {
		a.printInfo();
	}
	

}


